// 
import request from "./account.js"

// 获取轮播图的数据
export const GettingRotating = (params) => {
	return request({
		url: '/gettingRotating',
		method: 'get',
		data: params,
		header: {} // 自定义
	})
}

// 获取公告内容
export const GetBulletin = (params) => {
	return request({
		url: '/getBulletin',
		method: 'get',
		data: params,
		header: {} // 自定义
	})
}

// 获取类别
export const GetCategory = (params) => {
	return request({
		url: '/getCategory',
		method: 'get',
		data: params,
		header: {} // 自定义
	})
}



// 获取上架商品
export const GetShelving = (params) => {
	return request({
		url: '/getShelving',
		method: 'get',
		data: params,
		header: {} // 自定义
	})
}


// 获取推荐商品
export const GetRecommended = (params) => {
	return request({
		url: '/getRecommended',
		method: 'get',
		data: params,
		header: {} // 自定义
	})
}

// 通过在类别中获得商品数据
export const GetProductDataInCategory = (params) => {
	return request({
		url: '/getProductDataInCategory?category_id=' + params,
		method: 'get',
		data: params,
		header: {} // 自定义
	})
}

// 通过product_id 查询具体商品数据
export const GetProductDataFromId = (params) => {
	return request({
		url: "/getProductDataFromId",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


// 登录
export const Login = (params) => {
	return request({
		url: "/login",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}

// 注册
export const Register = (params) => {
	return request({
		url: "/register",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


// 通过id获取用户信息GetUserFromId
export const GetUserFromId = (params) => {
	return request({
		url: "/getUserFromId?user_id=" + params,
		method: 'get',
		data: params,
		header: {} // 自定义
	})
}

//添加购物车
export const AddShoppingCart = (params) => {
	return request({
		url: "/addShoppingCart",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


//得到个人购物车信息
export const GetShoppingCart = (params) => {
	return request({
		url: "/getShoppingCart?user_id=" + params,
		// url: "/getShoppingCart",
		method: 'get',
		data: params,
		header: {} // 自定义
	})
}

// 修改商品数量永久存储
export const ChangeQuantityInShopping = (params) => {
	return request({
		url: "/changeQuantityInShopping",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


// 删除购物车的信息
export const DeleteShoppingData = (params) => {
	return request({
		url: "/deleteShoppingData",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


// 通过id获取订单商品信息
export const GetShoppingDataFromId = (params) => {
	return request({
		url: "/getShoppingDataFromId",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


// 通过id获取收获地址
export const GetCustomersAddress = (params) => {
	return request({
		url: "/getCustomersAddress?user_id=" + params,
		method: 'get',
		data: params,
		header: {} // 自定义
	})
}

// 通过id删除收获地址
export const DeleteCustomersAddress = (params) => {
	return request({
		url: "/deleteCustomersAddress",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


// 添加个人许多地址
export const AddCustomersAddress = (params) => {
	return request({
		url: "/addCustomersAddress",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}

// 添加个人确认收获地址，到user表
export const AddCustomersAddressInUser = (params) => {
	return request({
		url: "/addCustomersAddressInUser",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


//获取个人确认收获地址，收获地址
export const GetShoppingAddressFromId = (params) => {
	return request({
		url: "/getShoppingAddressFromId",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


// 添加订单到orders的附表
export const AddOrderItemsSchedule = (params) => {
	return request({
		url: "/addOrderItemsSchedule",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}



// 添加订单到orders
export const AddOrders = (params) => {
	return request({
		url: "/addOrders",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


// 查询用户的订单
export const GetOrderFromId = (params) => {
	return request({
		url: "/getOrderFromId",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}

// 查询用户的订单的具体商品
export const GetOrderFromOrderId = (params) => {
	return request({
		url: "/getOrderFromOrderId",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}


// 修改订单的状态
export const ChangeOrderStatus = (params) => {
	return request({
		url: "/changeOrderStatus",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}

// changeShoppingInventory 修改订单的库存
export const ChangeShoppingInventory = (params) => {
	return request({
		url: "/changeShoppingInventory",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}

// changeCancelShoppingInventory  取消订单返回库存
export const ChangeCancelShoppingInventory = (params) => {
	return request({
		url: "/changeCancelShoppingInventory",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}

// 查询商品
export const SearchProduct = (params) => {
	return request({
		url: "/searchProduct",
		method: 'post',
		data: params,
		header: {} // 自定义
	})
}